﻿using System.Collections.Generic;
using System.Text;

namespace MockingBird.Common.Infrastructure.Extensions
{
    public static class ListExtensions
    {
        public static string Flatten(this List<string> list, string delimiter)
        {
            StringBuilder sb = new StringBuilder();
            if ((list == null) || (list.Count == 0))
                return "";

            foreach (string s in list)
            {
                sb.Append(s);
                sb.Append(delimiter);

            }
            return sb.ToString();

        }
    }
}
